package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @author vivi
 * @description
 * @date 2024/5/26
 */
@RestController
public class CalcController {

    @RequestMapping("/calc")
    public String calc(Integer num1, Integer num2) {
        if (num1 == null || num2 == null) {
            return "参数错误";
        }
        return "结果：" + (num1 + num2);
    }

}










